import { S } from '../../s';
import { IPSAppCounterRef } from '../control/ipsapp-counter-ref';
import { IPSAppViewUIAction } from './ipsapp-view-uiaction';
import { IPSUIAction } from '../../view/ipsuiaction';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSAppViewUIActionImpl
  extends PSModelObjectImpl
  implements IPSAppViewUIAction
{
  protected psappcounterref: IPSAppCounterRef;
  getPSAppCounterRef(): IPSAppCounterRef | null {
    return (
      this.psappcounterref ||
      (this.psappcounterref = this.fillObjectModel(
        S._9d,
        this.M.getPSAppCounterRef,
        S._2a9,
      ) as IPSAppCounterRef)
    );
  }

  protected psuiaction: IPSUIAction;
  getPSUIAction(): IPSUIAction | null {
    return (
      this.psuiaction ||
      (this.psuiaction = this.fillObjectModel(
        S._29d,
        this.M.getPSUIAction,
        S._2de,
      ) as IPSUIAction)
    );
  }

  get uIActionParamJO(): IModel {
    return this.M.uIActionParamJO;
  }

  get uIActionTarget():
    | 'SINGLEDATA'
    | 'SINGLEKEY'
    | 'MULTIDATA'
    | 'MULTIKEY'
    | 'NONE' {
    return this.M.uIActionTarget;
  }

  get xDataControlName(): string {
    return this.M.xDataControlName;
  }

  get saveTargetFirst(): boolean {
    return this.M.saveTargetFirst != null ? this.M.saveTargetFirst : false;
  }
  get cls(): string {
    return 'PSAppViewUIActionImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._8e) return true;
    return super.instanceof(cls);
  }
}
